﻿using System.Drawing;
using System.Web;

namespace TSharp.Core.Mvc.MvcCaptcha
{
    /// <summary>
    /// 验证码图片生成服务
    /// <para>2010/8/12</para>
    /// 	<para>TANGJINGBO</para>
    /// 	<para>tangjingbo</para>
    /// </summary>
    public interface ICaptchaImageService
    {
        /// <summary>
        /// 验证是否正确
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="captchaText">The captcha text.</param>
        /// <returns></returns>
        bool Validate(HttpContextBase context, string captchaText);

        /// <summary>
        /// 生成验证码图片
        /// </summary>
        /// <returns></returns>
        Bitmap GenerateImage();

        /// <summary>
        /// 生成新的验证文本
        /// </summary>
        void GenerateCaptchaText(HttpContextBase context);
    }
}